package model.person.notification;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import model.person.Person;

@Entity
@Table(name = "mynotification")
public class MyNotification implements Serializable {

	private static final long serialVersionUID = -5872978445077019861L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	Long id;

	@ManyToOne
	@JoinColumn(name = "id_from")
	Person from;

	@ManyToOne
	@JoinColumn(name = "id_to")
	Person to;

	public MyNotification(Person from, Person to) {
		this.from = from;
		this.to = to;
	}

	public MyNotification() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Person getFrom() {
		return from;
	}

	public void setFrom(Person from) {
		this.from = from;
	}

	public Person getTo() {
		return to;
	}

	public void setTo(Person to) {
		this.to = to;
	}

	@Override
	public String toString() {
		return "MyNotification [id=" + id + ", from=" + from + ", to=" + to + "]";
	}

}
